<template>
  <div class="app-container">
    <el-row :gutter="20" class="mb-20">
      <el-col :span="6">
        <el-card shadow="hover">
          <div class="stat-card">
            <div class="stat-icon primary">
              <el-icon :size="32"><Document /></el-icon>
            </div>
            <div class="stat-content">
              <div class="stat-title">总授权数</div>
              <div class="stat-value">0</div>
            </div>
          </div>
        </el-card>
      </el-col>
      <el-col :span="6">
        <el-card shadow="hover">
          <div class="stat-card">
            <div class="stat-icon success">
              <el-icon :size="32"><CircleCheck /></el-icon>
            </div>
            <div class="stat-content">
              <div class="stat-title">正常授权</div>
              <div class="stat-value">0</div>
            </div>
          </div>
        </el-card>
      </el-col>
      <el-col :span="6">
        <el-card shadow="hover">
          <div class="stat-card">
            <div class="stat-icon warning">
              <el-icon :size="32"><Clock /></el-icon>
            </div>
            <div class="stat-content">
              <div class="stat-title">即将过期</div>
              <div class="stat-value">0</div>
            </div>
          </div>
        </el-card>
      </el-col>
      <el-col :span="6">
        <el-card shadow="hover">
          <div class="stat-card">
            <div class="stat-icon danger">
              <el-icon :size="32"><WarningFilled /></el-icon>
            </div>
            <div class="stat-content">
              <div class="stat-title">已过期</div>
              <div class="stat-value">0</div>
            </div>
          </div>
        </el-card>
      </el-col>
    </el-row>

    <el-card shadow="hover">
      <template #header>
        <div class="card-header">
          <span>统计图表</span>
          <el-text type="info">功能开发中...</el-text>
        </div>
      </template>
      <div style="height: 300px; display: flex; align-items: center; justify-content: center;">
        <el-empty description="统计图表功能开发中" />
      </div>
    </el-card>
  </div>
</template>

<script setup name="LicenseStatistics">
const { proxy } = getCurrentInstance()

onMounted(() => {
  // 加载统计数据
})
</script>

<style scoped lang="scss">
.mb-20 {
  margin-bottom: 20px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 20px;

  .stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;

    &.primary {
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }

    &.success {
      background: linear-gradient(135deg, #5cb85c 0%, #4cae4c 100%);
    }

    &.warning {
      background: linear-gradient(135deg, #f0ad4e 0%, #ec971f 100%);
    }

    &.danger {
      background: linear-gradient(135deg, #d9534f 0%, #c9302c 100%);
    }
  }

  .stat-content {
    flex: 1;

    .stat-title {
      font-size: 14px;
      color: #909399;
      margin-bottom: 8px;
    }

    .stat-value {
      font-size: 24px;
      font-weight: bold;
      color: #303133;
    }
  }
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
</style>
